// 缺省页
module.exports = function (params) {
  const dft = {
    title: '',
    image: '',
    desc: '',
    cancelText: '',
    confirmText: '',
    cancel: false,
    confirm: false,
    itemClass: ''
  }
  let opts = Object.assign({}, dft, params)

  return {
    img: opts.image ? {
      src: opts.image,
      itemClass: 'item-pic'
    } : {},
    body: [
      opts.title ? {title: opts.title, itemClass: 'size-title-lg fw-bold color-title'} : '',
      opts.desc ? {title: opts.desc, itemClass: 'size-form color-info mt-minor'} : ''
    ],
    footer: [
      opts.cancel ? {title: opts.cancelText || '返回', aim: opts.onCancel, itemClass: 'ss-button btn-grey btn-wid-3 plain'} : '',
      opts.confirm ? {title: opts.confirmText || '确认', aim: opts.onConfirm, itemClass: 'ss-button btn-default btn-wid-3 '} : '',
    ],
    footerClass: 'flex-row item-footer',
    itemClass: ('item-default ' + opts.itemClass),
  }
}